package idgen

import "time"

// CREATE TABLE  `worker_id`  (
//  `worker_name` varchar(64) NOT NULL DEFAULT 'default',
//  `worker_id_incr` bigint(20) UNSIGNED NOT NULL DEFAULT 1,
//  PRIMARY KEY (`worker_name`)
//);
type WorkerId struct {
	WorkerName   string `db:"worker_name,pk"`
	WorkerIdIncr int64
}

//CREATE TABLE `po0`.`worker_renewal`  (
//  `worker_name` varchar(64) NOT NULL DEFAULT 'default',
//  `worker_id` bigint(20) UNSIGNED NOT NULL DEFAULT 1,
//  `updated_at` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
//  `expired_at` datetime(6) NOT NULL,
//  PRIMARY KEY (`worker_name`, `worker_id`)
//);
type WorkerRenewal struct {
	WorkerName string    `db:"worker_name,uni"`
	WorkerId   int64     `db:"worker_id,uni"`
	UpdatedAt  time.Time `db:"updated_at,omitempty"`
	ExpiredAt  time.Time
}
